<template>
	<div class="container home">
		<div class="header">
			<!-- <Header></Header> -->
			<div class="slogan">埔企查 安全靠谱查企业</div>
			<div class="search" id="history-record">
				<div class="box">
					<el-input @blur="hidehistory" @focus="showhistory" class="el-input" v-model="entname"
						placeholder="请输入企业名称" prefix-icon="el-icon-search"></el-input>
					<div class="search-bt pointer" @click="searchname()">搜索</div>
				</div>
				<!-- <div class="advanced-search" @click="query()">高级搜索</div> -->
				<div class="srarch-history" v-show="shhistory == 1 && historyList.length > 0">
					<ul>
						<li class="pointer" v-for="(item,index) in historyList.slice(0,10)" :key="index"
							@click="goSearchDetail(item)"><i class="el-icon-time"></i>{{item}}</li>
					</ul>
					<div class="emptybox"><span class="pointer" @click="empty"><i class="el-icon-delete"></i>删除记录</span>
					</div>
				</div>
			</div>
		</div>
		<div class="maincontainer wd1200">

			<div class="select-box">
				<div class="box">
					<div class="commonpopover" id="mcbox">
						<el-input @blur="hidemc" @focus="showmc" placeholder="请选择" class="pointer"
							suffix-icon="el-icon-arrow-down" v-model="sqval" slot="reference">
						</el-input>
						<div class="industrybox commondown" v-show="qyvisible">
							<div class="industry">
								<!-- <div class="ibox">
									<div class="pointer" v-for="item in regionlist" :key="item.id" @click="qy1(item.mc)"
										:class="mcname == item.mc? 'active' : ''">
										<p>{{item.mc}}</p>
									</div>
								</div> -->
								<div class="ibox" ref="scrollContainer">
									<div class="pointer" v-for="item in jdlist" :key="item.id"
										@click="clickqy2(item.mc)" :class="mcname2 == item.mc? 'active' : ''">
										<p>{{item.mc}}</p>
									</div>
								</div>
								<!-- <div class="ibox" v-show="sqlist.length > 0">
									<div class="pointer" v-for="item in sqlist" :key="item.id" @click="qy3(item.mc)"
										:class="mcname3 == item.mc? 'active' : ''">
										<p>{{item.mc}}</p>
									</div>
								</div> -->
							</div>
							<div class="bottomibox">
								<el-row>
									<el-button size="mini" @click="qyreset">重置</el-button>
									<el-button size="mini" type="primary" @click="qyprimary">确定</el-button>
								</el-row>
							</div>
						</div>
					</div>
				</div>
				<div class="box">
					<div class="commonpopover" id="codebox">
						<el-input @blur="hidecode" @focus="showcode" placeholder="行业分类" class="pointer"
							suffix-icon="el-icon-arrow-down" v-model="industry" slot="reference">
						</el-input>
						<div class="industrybox commondown" v-show="visible">
							<div class="industry">
								<div class="ibox">
									<div class="pointer" v-for="item in industrylist" :key="item.industryL1Code"
										@click="industry1(item.industryL1Code,item.industryL1Name)"
										:class="Code1 == item.industryL1Code? 'active' : ''">
										<p v-if="item.industryL1Name != null">{{item.industryL1Name}}</p>
									</div>
								</div>
								<div class="ibox" v-show="industrylist2.length > 0">
									<div class="pointer" v-for="item in industrylist2" :key="item.industryL2Code"
										@click="industry2(item.industryL2Code,item.industryL2Name)"
										:class="Code2 == item.industryL2Code? 'active' : ''">
										<p v-if="item.industryL2Name != null">{{item.industryL2Name}}</p>
									</div>
								</div>
								<div class="ibox" v-show="industrylist3.length > 0">
									<div class="pointer" v-for="item in industrylist3" :key="item.industryL3Code"
										@click="industry3(item.industryL3Code,item.industryL3Name)"
										:class="Code3 == item.industryL3Code? 'active' : ''">
										<p v-if="item.industryL3Name != null">{{item.industryL3Name}}</p>
									</div>
								</div>
							</div>
							<div class="bottomibox">
								<el-row>
									<el-button size="mini" @click="xyreset">重置</el-button>
									<el-button size="mini" type="primary" @click="xyprimary">确定</el-button>
								</el-row>
							</div>
						</div>
					</div>

				</div>
				<div class="box">
					<el-select v-model="sort" placeholder="默认排序" class="el-select" @change="sortchange">
						<el-option label="默认排序" value=""></el-option>
						<el-option label="按注册资本从小到大" value="1"></el-option>
						<el-option label="按注册资本从大到小" value="2"></el-option>
						<el-option label="按注册时间从早到晚" value="3"></el-option>
						<el-option label="按注册时间从晚到早" value="4"></el-option>
					</el-select>
				</div>
			</div>
			
			<div class="selected-box overflow" v-show="openzs == 0">
				<div class="title fl">已选</div>
				<div class="overflow">
					<el-tag class="taglist" v-show="ssfwlist != null">关键词：{{entnames}}</el-tag>
					<el-tag class="taglist" v-show="ssfwlistname != ''">搜索范围：{{ssfwlistname}}</el-tag>
					<el-tag class="taglist" v-show="industry !=''">行业分类：{{industry}}</el-tag>
					<el-tag class="taglist" v-show="cbrsname !=null && cbrsname !=''">参保人数：{{cbrsname}}</el-tag>
					<el-tag class="taglist" v-show="clnxname !=null && clnxname !=''">成立年限：{{clnxname}}</el-tag>
					<el-tag class="taglist" v-show="qyztname !=null && qyztname !=''">企业状态：{{qyztname}}</el-tag>
					<el-tag class="taglist" v-show="zczbname !=null && zczbname !=''">注册资本：{{zczbname}}</el-tag>
					<el-tag class="taglist" v-show="sjzbname !=null && sjzbname !=''">实缴资本：{{sjzbname}}</el-tag>
					<el-tag class="taglist" v-show="qylxname !=null && qylxname !=''">资本类型：{{qylxname}}</el-tag>
					<el-tag class="taglist" v-show="zblxname !=null && zblxname !=''">企业类型：{{zblxname}}</el-tag>
					<el-tag class="taglist" v-show="zllxname !=null && zllxname !=''">专利类型：{{zllxname}}</el-tag>
					<el-tag class="taglist" v-show="zzzsname !=null && zzzsname !=''"">资质证书：{{zzzsname}}</el-tag>
				</div>
			</div>
			<div class="enterprise-list overflow" v-loading="loading">
				<div class="list overflow" v-for="item in enterpriselist" :key="item.ID">
					<div class="tag fl" @click="details(item.COMPANY_ID,item.CREDIT_NO)">
						{{item.COMPANY_NAME.substr(0, 2)}}</div>
					<div class="text overflow">
						<div class="title pointer" @click="details(item.COMPANY_ID,item.CREDIT_NO)">
							{{item.COMPANY_NAME}}</div>
						<div class="info">
							<div class="box">法人：{{item.LEGAL_PERSON}}</div>
							<div class="box">注册日期：<span
									v-if="item.OPERATION_STARTDATE !=null && item.OPERATION_STARTDATE !=''">{{item.OPERATION_STARTDATE}}</span><span
									v-else>--</span></div>
							<div class="box">注册资本：<span
									v-if="item.CAPITAL !=null && item.CAPITAL !=''">{{item.CAPITAL_NUM}}{{item.CAPITAL.match(/[\u4e00-\u9fa5]/g).join('')}}</span><span
									v-else>--</span></div>
							<div class="box">社保人数：<span
									v-if="item.INSURANCE_AMOUNT_COUNT !=null">{{item.INSURANCE_AMOUNT_COUNT}}</span><span
									v-else>--</span></div>
						</div>
						<div class="address"><span>企业地址：</span>{{item.COMPANY_ADDRESS}}</div>
						<div class="details" @click="details(item.COMPANY_ID,item.CREDIT_NO)">查看详情</div>
					</div>
				</div>
				<div class="pagination overflow" v-if="total > 0">
					<el-pagination background layout="prev, pager, next" @current-change="handleCurrentChange"
						:page-size="5" :current-page="currentPage" :total="total">
					</el-pagination>
				</div>
				<template v-else>
					<el-empty :image="require('../../assets/icons/icons.png')" :image-size="200"></el-empty>
				</template>
			</div>

			
			<div class="clearfix"></div>
		</div>
		<Footer></Footer>

	</div>
</template>

<script>
	import {
		regionapi,
		industryapi,
		industryapi2,
		industryapi3,
		sdqygjsslist,
		sdqygjsscount,
		sdqygjssv1api,
		tokenapi
	} from "@/api/enterprise/index";
	import Header from "@/components/header";
	import Footer from "@/components/footer";
	export default {
		components: {
			Header,
			Footer
		},
		data() {
			return {
				historyList: [],
				shhistory: 0,
				street: '0',
				industry: '',
				sort: '',
				entname: '',
				pageNumber: 1,
				pageSize: 5,
				enterpriselist: [],
				total: 0,
				loading: true,
				regionlist: [],
				jdlist: [],
				sqlist: [],
				industrylist: [],
				industrylist2: [],
				industrylist3: [],
				Code1: '',
				Code2: '',
				Code3: '',
				industry_one: "",
				industry_two: "",
				industry_three: "",
				visible: false,
				qyvisible: false,
				sqval: "黄埔区",
				mcname: '黄埔区',
				mcname2: '',
				mcname3: '',
				areaname: '黄埔区',
				jdmc: '',
				sqmc: '',
				currentPage: 1,
				searchType: '',
				listParams: '',
				arr: [],
				cbrslist: '',
				clnxlist: '',
				zczblist: '',
				sjzblist: '',
				openfilter: 0,
				ssfwlist: [],
				hidtype: 0,
				urltoken:'',
				opentokenlogin:0,
				openzs:1,
				ssfwlistname:'',
				entnames:'',
				cbrsname:null,
				clnxname:null,
				qyztname:null,
				zczbname:null,
				sjzbname:null,
				qylxname:null,
				zblxname:null,
				zzzsname:null,
				zllxname:null
			};
		},
		created() {

			this.openfilter = this.$route.query.filter
			if (this.$route.query.searchType == 'zs') {
				this.openzs = 0
				this.hidtype = 1
				this.listParams = JSON.parse(sessionStorage.getItem("listParams"));
				this.ssfwlist = JSON.parse(sessionStorage.getItem("ssfwlist"));
				this.cbrsname = JSON.parse(sessionStorage.getItem("cbrsname"));
				this.clnxname = JSON.parse(sessionStorage.getItem("clnxname"));
				this.qyztname = JSON.parse(sessionStorage.getItem("qyztname"));
				this.zczbname = JSON.parse(sessionStorage.getItem("zczbname"));
				this.sjzbname = JSON.parse(sessionStorage.getItem("sjzbname"));
				this.qylxname = JSON.parse(sessionStorage.getItem("qylxname"));
				this.zblxname = JSON.parse(sessionStorage.getItem("zblxname"));
				this.zzzsname = JSON.parse(sessionStorage.getItem("zzzsname"));
				this.zllxname = JSON.parse(sessionStorage.getItem("zllxname"));
				if (this.ssfwlist != null) {
					
					if (this.ssfwlist.length > 0) {
						let ssfwlistname = JSON.parse(sessionStorage.getItem("ssfwlistname"));
						this.ssfwlistname = ssfwlistname.join('，')
						if (this.listParams.name != undefined) {
							this.entnames = this.listParams.name
						}
						if (this.listParams.dzmc != undefined) {
							this.entnames = this.listParams.dzmc
						}
						if (this.listParams.opscope != undefined) {
							this.entnames = this.listParams.opscope
						}
						if (this.listParams.zpmc != undefined) {
							this.entnames = this.listParams.zpmc
						}
						if (this.listParams.sbmc != undefined) {
							this.entnames = this.listParams.sbmc
						}
						if (this.listParams.zlmc != undefined) {
							this.entnames = this.listParams.zlmc
						}
						if (this.listParams.wzmc != undefined) {
							this.entnames = this.listParams.wzmc
						}
						if (this.listParams.ent_name != '') {
							this.entnames = this.listParams.ent_name
						}

					} else {
						this.entnames = this.listParams.ent_name
					}
				}

				this.pageSize = 5
				this.pageNumber = 1
				this.industry_one = this.listParams.industry_one
				this.industry_two = this.listParams.industry_two
				this.industry_three = this.listParams.industry_three
				this.ent_names = this.listParams.ent_name
				this.arr = this.listParams.tagId
				this.cbrslist = this.listParams.cbrs
				this.clnxlist = this.listParams.clnx
				this.zczblist = this.listParams.zczb
				this.sjzblist = this.listParams.sjzb
				if (this.industry_three != '') {
					this.industry = this.industry_one + '/' + this.industry_two + '/' + this.industry_three
					this.Code1 = this.listParams.Code1
					this.industryinit2()
					this.Code2 = this.listParams.Code2
					this.industryinit3()
					this.Code3 = this.listParams.Code3

				} else if (this.industry_two != '') {
					this.industry = this.industry_one + '/' + this.industry_two
					this.Code1 = this.listParams.Code1
					this.industryinit2()
					this.Code2 = this.listParams.Code2
					this.industryinit3()
					this.Code3 = this.listParams.Code3
				} else if (this.industry_one != '') {
					this.industry = this.industry_one
					this.Code1 = this.listParams.Code1
					this.industryinit2()
					this.Code2 = this.listParams.Code2
				}

			} else {
				this.openzs = 1
				this.listParams = JSON.parse(sessionStorage.getItem("listParams"));
				if (this.listParams != null) {
					this.pageSize = this.listParams.pageSize
					this.pageNumber = this.listParams.pageNumber
					this.industry_one = this.listParams.industry_one
					this.industry_two = this.listParams.industry_two
					this.industry_three = this.listParams.industry_three
					this.entname = this.listParams.ent_name
					this.arr = this.listParams.tagId
					this.cbrslist = this.listParams.cbrs
					this.clnxlist = this.listParams.clnx
					this.zczblist = this.listParams.zczb
					this.sjzblist = this.listParams.sjzb
					this.mcname2 = this.listParams.street
					this.jdmc = this.listParams.street
					this.sort = this.listParams.orderStatus
					if (this.listParams.street != '') {
						this.sqval = this.listParams.street
					} else {
						this.sqval = '黄埔区'
					}
					if (this.industry_three != '') {
						this.industry = this.industry_one + '/' + this.industry_two + '/' + this.industry_three
						this.Code1 = this.listParams.Code1
						this.industryinit2()
						this.Code2 = this.listParams.Code2
						this.industryinit3()
						this.Code3 = this.listParams.Code3

					} else if (this.industry_two != '') {
						this.industry = this.industry_one + '/' + this.industry_two
						this.Code1 = this.listParams.Code1
						this.industryinit2()
						this.Code2 = this.listParams.Code2
						this.industryinit3()
						this.Code3 = this.listParams.Code3
					} else if (this.industry_one != '') {
						this.industry = this.industry_one
						this.Code1 = this.listParams.Code1
						this.industryinit2()
						this.Code2 = this.listParams.Code2
					}
				}
			}
			if (JSON.parse(localStorage.getItem("historyList"))) {
				this.historyList = JSON.parse(localStorage.getItem("historyList"));
			}
			this.regioninit()
			this.jdinit()
			// this.sqinit()
			// this.wginit()
			this.industryinit()
			this.listinit()
			this.countinit()
		},
		mounted() {
			const container = this.$refs.scrollContainer;
			console.log('container', window.location.href)
			this.urltoken = this.$route.query.token
			console.log('this.urltoken', this.urltoken)
			this.gettokeninit()
			
		},
		methods: {
			gettokeninit(){
				let queryParams = {
					token:this.urltoken
				}
				tokenapi(queryParams).then(res => {
					if(res.data != null){
						if(res.data.id == null ){
							this.opentokenlogin = 0
						}else{
							this.opentokenlogin = 1
						}
						
					}else{
						this.opentokenlogin = 0
					}
					
				})
			},
			showmc() {
				this.qyvisible = true
			},
			hidemc() {
				document.addEventListener("click", e => {
					var box = document.getElementById("mcbox");
					if (!box.contains(e.target)) {
						this.qyvisible = false
					}
				})
			},
			showcode() {
				this.visible = true
			},
			hidecode() {
				document.addEventListener("click", e => {
					var box = document.getElementById("codebox");
					if (!box.contains(e.target)) {
						this.visible = false
						if (this.hidtype == 0) {
							this.Code1 = ''
							this.industry_one = ''
							this.Code2 = ''
							this.industry_two = ''
							this.industrylist2 = ''
							this.industrylist3 = ''
							this.industry = ''
							this.Code3 = ''
							this.industry_three = ''
						}
					}
				})
			},
			hidehistory() {
				document.addEventListener("click", e => {
					var box = document.getElementById("history-record");
					if (!box.contains(e.target)) {
						this.shhistory = 0;
					}
				})
			},
			showhistory() {
				this.shhistory = 1
			},
			qy1(name) {
				this.areaname = name
				this.mcname = name
			},
			clickqy2(name) {
				this.jdmc = name
				this.mcname2 = name
				this.sqval = name
				this.sqlist = []
				// this.sqinit()
				this.loading = true
				this.qyvisible = false
				this.pageNumber = 1
				this.total = 0
				this.listinit()
				this.countinit()
			},
			qy3(name) {
				this.sqmc = name
				this.sqval = name
				this.mcname3 = name
				this.loading = true
				this.qyvisible = false
				this.pageNumber = 1
				this.total = 0
				this.listinit()
				this.countinit()
			},
			qyreset() {
				this.mcname2 = ''
				this.mcname3 = ''
				this.sqval = '黄埔区'
				this.sqlist = []
				this.jdmc = ''
				this.loading = true
				this.qyvisible = false
				this.pageNumber = 1
				this.total = 0
				this.listinit()
				this.countinit()
			},
			qyprimary() {
				this.loading = true
				this.qyvisible = false
				this.pageNumber = 1
				this.total = 0
				this.listinit()
				this.countinit()
			},
			industry1(code, name) {
				console.log('code', code)
				this.Code1 = code
				this.industry_one = name
				// this.industry = name
				this.industryinit2()
			},
			industry2(code, name) {
				console.log('code2', code)
				this.Code2 = code
				this.industry_two = name
				// this.industry = this.industry_one+'/'+this.industry_two
				this.industryinit3()
			},
			industry3(code, name) {
				console.log('code3', code)
				this.Code3 = code
				this.industry_three = name
				// this.industry = this.industry_one+'/'+this.industry_two+'/'+this.industry_three
				// this.loading = true
				// this.visible = false
				// this.pageNumber = 1
				// this.total = 0
				// this.listinit()
				// this.countinit()
			},
			xyreset() {
				this.Code1 = ''
				this.industry_one = ''
				this.Code2 = ''
				this.industry_two = ''
				this.industrylist2 = ''
				this.industrylist3 = ''
				this.industry = ''
				this.Code3 = ''
				this.industry_three = ''
				this.loading = true
				this.visible = false
				this.pageNumber = 1
				this.total = 0
				this.listinit()
				this.countinit()
			},
			xyprimary() {
				if (this.industry_three != '') {
					this.industry = this.industry_one + '/' + this.industry_two + '/' + this.industry_three
				} else if (this.industry_two != '' && this.industry_three == '') {
					this.industry = this.industry_one + '/' + this.industry_two
				} else if (this.industry_two == '') {
					this.industry = this.industry_one
				}
				this.hidtype = 1
				this.loading = true
				this.visible = false
				this.pageNumber = 1
				this.total = 0
				this.listinit()
				this.countinit()
			},
			searchname() {
				if (this.entname == '') {
					this.shhistory = 0
					this.loading = true
					this.pageNumber = 1
					this.total = 0
					this.listinit()
					this.countinit()
					// this.$toast('请输入搜索内容');
					// return false;
				} else {
					if (!this.historyList.includes(this.entname)) {
						this.historyList.unshift(this.entname);
						localStorage.setItem("historyList", JSON.stringify(this.historyList));
					} else {
						//有搜索记录，删除之前的旧记录，将新搜索值重新push到数组首位
						let i = this.historyList.indexOf(this.entname);
						this.historyList.splice(i, 1)
						this.historyList.unshift(this.entname);
						localStorage.setItem("historyList", JSON.stringify(this.historyList));
					}
					this.shhistory = 0
					this.loading = true
					this.pageNumber = 1
					this.total = 0
					this.listinit()
					this.countinit()
				}

			},
			goSearchDetail(title) {
				this.entname = title
				this.searchname()
				this.shhistory = 0
			},

			//清空历史搜索记录
			empty() {
				localStorage.removeItem('historyList');
				this.historyList = [];
			},
			regioninit() {
				let queryParams = {
					flag: 'sgpz',
					pageNumber: 1,
					pageSize: 999,
				}
				regionapi(queryParams).then(res => {
					console.log('regionapi', res)
					this.regionlist = res.data.content
				});
			},
			jdinit() {
				let queryParams = {
					flag: 'jd',
					pageSize: 9999,
				}
				regionapi(queryParams).then(res => {
					console.log('jd', res)
					this.jdlist = res.data.content
				});
			},
			sqinit() {
				let queryParams = {
					flag: 'sq',
					pageSize: 9999,
				}
				regionapi(queryParams).then(res => {
					this.sqlist = []
					res.data.content.forEach(item => {
						console.log('item', item)
						if (item.jdmc == this.jdmc) {
							console.log('item.jdmc', item.jdmc)
							this.sqlist.push(item)
						}
					})
				});
			},
			wginit() {
				let queryParams = {
					flag: 'wg',
					pageSize: 9999,
				}
				regionapi(queryParams).then(res => {
					console.log('wg', res)
					this.regionlist = res.data.content
				});
			},
			industryinit() {
				let queryParams = {
					pageSize: 9999,
				}
				industryapi(queryParams).then(res => {
					console.log('industryapi', res)
					this.industrylist = res.data.content
				});
			},
			industryinit2() {
				let queryParams = {
					industryCode: this.Code1,
					pageSize: 9999,
				}
				industryapi2(queryParams).then(res => {
					console.log('industryapi', res)
					this.industrylist2 = res.data.content
				});
			},
			industryinit3() {
				let queryParams = {
					industryCode: this.Code2,
					pageSize: 9999,
				}
				industryapi3(queryParams).then(res => {
					console.log('industryapi', res)
					this.industrylist3 = res.data.content
				});
			},
			industrychange(val) {
				console.log('val', val)
				this.loading = true
				this.pageNumber = 1
				this.total = 0
				this.listinit()
				this.countinit()
			},
			sortchange() {
				this.loading = true
				this.pageNumber = 1
				this.total = 0
				this.listinit()
				this.countinit()
			},
			listinit() {
				let queryParams = {
					ent_name: this.entname,
					district: this.areaname,
					street: this.jdmc,
					pageNumber: this.pageNumber,
					pageSize: this.pageSize,
					// sqmc: this.sqmc,
					orderStatus: this.sort,
					industry_one: this.industry_one,
					industry_two: this.industry_two,
					industry_three: this.industry_three,
					tagId: this.arr,
					cbrs: this.cbrslist,
					clnx: this.clnxlist,
					zczb: this.zczblist,
					sjzb: this.sjzblist

				}
				this.listParams = queryParams
				this.$set(this.listParams, 'Code1', this.Code1);
				this.$set(this.listParams, 'Code2', this.Code2);
				this.$set(this.listParams, 'Code3', this.Code3);
				if (this.$route.query.searchType == 'zs') {
					this.$set(queryParams, 'ent_name', this.ent_names);
					if (this.ssfwlist != null) {
						if (this.entnames != '' && this.ssfwlist.length > 0) {
							this.ssfwlist.forEach(item => {
								if (item != 'ent_name') {
									this.$set(queryParams, item, this.entnames);
								}
							})
							if (this.ssfwlist.indexOf('ent_name') == -1) {
								this.$set(queryParams, 'ent_name', '');
							}
						}
					}

				}
				sdqygjssv1api(queryParams).then(res => {
					this.loading = false
					this.enterpriselist = res.data.content
					// this.total = res.data.total
				});
			},
			countinit() {
				// this.total = 0
				let queryParams = {
					ent_name: this.entname,
					district: this.areaname,
					street: this.jdmc,
					pageNumber: this.pageNumber,
					pageSize: this.pageSize,
					// sqmc: this.sqmc,
					orderStatus: this.sort,
					industry_one: this.industry_one,
					industry_two: this.industry_two,
					industry_three: this.industry_three,
					tagId: this.arr,
					cbrs: this.cbrslist,
					clnx: this.clnxlist,
					zczb: this.zczblist,
					sjzb: this.sjzblist,
					searchType: "zs",

				}
				if (this.$route.query.searchType == 'zs') {
					this.$set(queryParams, 'ent_name', this.ent_names);
					if (this.ssfwlist != null) {
						if (this.entnames != '' && this.ssfwlist.length > 0) {
							this.ssfwlist.forEach(item => {
								if (item != 'ent_name') {
									this.$set(queryParams, item, this.entnames);
								}
							})
							if (this.ssfwlist.indexOf('ent_name') == -1) {
								this.$set(queryParams, 'ent_name', '');
							}
						}
					}
				}
				sdqygjssv1api(queryParams).then(res => {
					this.total = res.data.content[0].TOTAL
				});
			},
			handleCurrentChange(val) {
				console.log('valval', val)
				this.pageNumber = val
				this.loading = true
				this.listinit()
				this.countinit()
			},
			query() {
				this.$router.push({
					path: '/query'
				})
			},
			details(id, uniscid) {
				sessionStorage.setItem('listParams', JSON.stringify(this.listParams))
				this.currentUrl = window.location.href
				this.urlhref = this.currentUrl.split('/')[2]
				console.log('this.urlhref',this.urlhref)
				if (this.opentokenlogin == 1) {
					this.token = this.$route.query.token
					let url = 'http://'+this.urlhref+`/pqt-pc/details?id=${encodeURIComponent(id)}&uniscid=${encodeURIComponent(uniscid)}&token=${encodeURIComponent(this.token)}`;
					// window.open(url, '_blank');
					this.$router.push({
						path: '/details',
						query: {
							id: id,
							uniscid: uniscid,
							token: this.token
						}
					})
				} else {
					  window.parent.postMessage({
						  data: {
							  code: "success",
							  isLogin: "false"
						  }
					  }, '*');
					 
					// this.$confirm('当前操作需要登录才可操作，请先登录。', '', {
					// 	confirmButtonText: '确定',
					// 	cancelButtonText: '取消',
					// 	type: 'warning'
					// }).then(() => {
					// 	const externalUrl = 'https://puqitong.com/enterprise/login';
					// 	window.location.href = externalUrl;
					// }).catch(() => {
						
					// });
					// this.$router.push({
					// 	path: '/details',
					// 	query: {
					// 		id: id,
					// 		uniscid: uniscid
					// 	}
					// })
				}

			},
		}
	};
</script>

<style scoped lang="scss">
	.el-message-box{vertical-align: super !important;}
	.home {
		.header {
			height: 418px;
			background: url(../../assets/images/banner.png) no-repeat left center;

			.navbar {
				border-bottom: 1px solid rgba(255, 255, 255, 0.2);
				height: 100px;
				padding: 0 30px;

				.logo {
					display: flex;
					justify-content: center;
					align-items: center;
					height: 100px;
					font-size: 26px;
					color: #fff;
					font-weight: bold;
					margin-right: 8%;

					img {
						margin-right: 11px;
					}
				}

				.nav {
					display: flex;
					height: 100px;
					justify-content: center;
					align-items: center;
					font-size: 20px;
					color: #fff;
					font-weight: bold;

					.box {
						position: relative;
						height: 100px;
						line-height: 100px;

						span {
							position: absolute;
							left: 0;
							bottom: 0;
							height: 5px;
							background: #fff;
							display: block;
							width: 60px;
						}
					}

					.box::after {
						content: "|";
						margin: 0 36px;
						color: rgba(255, 255, 255, 0.2);
						font-weight: initial;
						font-size: 18px;
					}

					.box:last-child::after {
						display: none;
					}

				}

				.user {
					display: flex;
					height: 95px;
					justify-content: center;
					align-items: center;

					.box {
						font-size: 16px;
						line-height: 28px;
						color: #FFFFFF;
						font-weight: 400;
						background: url(../../assets/images/usericon.png) no-repeat left center;
						padding-left: 22px;
					}

					.bt {
						width: 62px;
						height: 28px;
						line-height: 28px;
						text-align: center;
						background: #FFFFFF;
						border-radius: 5px 5px 5px 5px;
						font-size: 12px;
						color: #000000;
						font-weight: 400;
						margin-left: 10px;
						cursor: pointer;
					}
				}
			}

			.slogan {
				color: #fff;
				font-size: 42px;
				color: #FFFFFF;
				text-align: center;
				font-weight: bold;
				letter-spacing: 3px;
				line-height: 55px;
				padding: 84px 0 54px;
				background: linear-gradient(83.43932649717124deg, #FAFEFE 0%, #F3F9FF 41%, #B6C9EB 100%);
				-webkit-background-clip: text;
				/*将设置的背景颜色限制在文字中*/
				-webkit-text-fill-color: transparent;
				/*给文字设置成透明*/
			}

			.search {
				display: flex;
				justify-content: left;
				align-items: center;
				position: relative;
				width: 870px;
				margin: auto;

				.box {
					display: flex;

					.search-bt {
						width: 120px;
						height: 53px;
						background: #FA8901;
						border-radius: 0px 4px 4px 0px;
						font-size: 22px;
						color: #FFFFFF;
						font-weight: 400;
						text-align: center;
						line-height: 53px;
						letter-spacing: 2px;
					}
				}

				.advanced-search {
					width: 32px;
					height: 40px;
					line-height: 20px;
					font-size: 16px;
					font-weight: 400;
					color: #FFFFFF;
					margin-left: 12px;
					cursor: pointer;
					text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.7);
				}

				.srarch-history {
					position: absolute;
					left: 0;
					top: 53px;
					width: 706px;
					background: #fff;
					border-radius: 4px 4px 4px 4px;
					border: 1px solid #E8EAEC;
					box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
					z-index: 999999;

					ul {
						padding: 0;
						margin: 0;

						li {
							list-style: none;
							height: 34px;
							line-height: 34px;
							font-weight: bold;
							font-size: 14px;
							color: #616266;
							padding: 0 22px;

							i {
								color: #999;
								margin-right: 6px;
							}
						}

						li:hover {
							background: #F6F7FA;
							color: #227FE4;
						}
					}

					.emptybox {
						height: 34px;
						line-height: 34px;
						text-align: right;
						padding: 0 22px;
						font-weight: bold;
						font-size: 14px;
						color: #999999;
						margin-bottom: 16px;

						i {
							margin-right: 6px;
						}
					}
				}
			}
		}

		.select-box {
			display: flex;
			padding: 30px 0 0;

			.box {
				margin-right: 20px;
				width: 386px;

				.el-select {
					width: 100%;
				}

			}

			.box:last-child {
				margin-right: 0;
			}

			.commonpopover {
				position: relative;

				.commondown {
					position: absolute;
					left: 0;
					top: 38px;
					z-index: 999;
					background: #fff;
					box-shadow: 0px -2px 12px 0px rgb(7 28 69 / 25%);
				}
			}
		}
		.selected-box{
			background: #F4F8FC;
			border: 1px solid #E8EAEC;
			margin-top: 32px;
			padding: 12px 0 0px;
			.title{
				font-weight: bold;
				font-size: 14px;
				color: #222222;
				margin: 0 18px 0 24px;
				line-height: 28px;
				
			}
			.title::after{
				content: "|";
				font-weight: normal;
				color: #E8EAEC;
				margin-left: 18px;
			}
			.taglist{margin: 0 16px 12px 0;}
		}
		.enterprise-list {
			.list {
				padding: 36px 0;
				border-bottom: 1px solid #E8EAEC;
				color: #000000;
				font-size: 16px;

				.tag {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 72px;
					height: 72px;
					border-radius: 4px 4px 4px 4px;
					background: #7DB3DA;
					font-size: 22px;
					color: #fff;
					margin-right: 24px;
				}

				.text {
					position: relative;
				}

				.title {
					font-size: 18px;
					font-weight: bold;
					line-height: 24px;
					margin-bottom: 14px;
				}

				.info {
					display: flex;
					margin-bottom: 14px;

					.box {
						font-weight: 400;
						line-height: 21px;
						margin-right: 60px;
						background: url(../../assets/images/icon01.png) no-repeat left center;
						padding-left: 20px;
					}

					.box:nth-child(2) {
						background: url(../../assets/images/icon02.png) no-repeat left center;
					}

					.box:nth-child(3) {
						background: url(../../assets/images/icon03.png) no-repeat left center;
					}

					.box:nth-child(4) {
						background: url(../../assets/images/icon04.png) no-repeat left center;
					}

					.box:last-child {
						margin-right: 0;
					}
				}

				.address {
					font-weight: 400;
					line-height: 21px;

					span {
						color: #999999;
					}
				}

				.details {
					position: absolute;
					right: 0;
					top: 50%;
					width: 112px;
					height: 40px;
					background: #217FE4;
					border-radius: 2px;
					text-align: center;
					line-height: 40px;
					color: #fff;
					font-size: 16px;
					font-weight: 400;
					transform: translateY(-50%);
					cursor: pointer;
				}
			}

		}

		.pagination {
			float: right;
			margin-top: 30px;
		}

		.common-footer {
			min-height: 79px;
			background: #EFF1F3;
			font-size: 12px;
			color: #656C74;
			line-height: 17px;
			margin-top: 98px;

			.topnav {
				padding: 16px 0 12px;
				text-align: center;
				display: flex;
				justify-content: center;

				.box::after {
					content: '|';
					margin: 0 12px;
					color: #656C74;
				}

				.box:last-child::after {
					display: none;
				}
			}

			.binfo {
				display: flex;

				.box {
					margin-right: 90px;
				}

				.box:last-child {
					margin-right: 0;
					background: url(../../assets/images/ficon01.png) no-repeat left center;
					padding-left: 20px;
				}
			}
		}
	}
</style>
<style>
	.el-message-box{vertical-align: super !important;}
	.industry {
		display: flex;
	}

	.industry .ibox {
		height: 200px;
		overflow-y: auto;
		width: 310px;
		border-right: 1px solid #eee;
	}

	.industry .ibox:first-child {
		padding-left: 0;
	}

	.industry .ibox:last-child {
		border-right: none;
	}

	.industry .ibox div.active {
		/* color: #1890ff; */
	}

	.industry .ibox div P {
		margin: 0;
		height: 36px;
		line-height: 36px;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		padding: 0 6px 0 34px;
		background: url(../../assets/images/checkbox-input.png) no-repeat 12px center;
	}

	.industry .ibox div P::after {
		content: '';
		background: url(../../assets/images/right.png) no-repeat right center;
		float: right;
		display: block;
		height: 36px;
		width: 12px;
	}

	.el-popover {
		padding: 0;
	}

	.industry .ibox div.active p {
		background: #E5F2FF url(../../assets/images/hcheckbox-input.png) no-repeat 12px center;
		color: #227FE4;
	}

	.bottomibox {
		border-top: 1px solid #eee;
		padding: 10px;
		text-align: right;
	}

	.bottomibox .el-row {
		display: inline-block;
	}

	.home .enterprise-list .list:nth-child(5n+2) .tag {
		background: #BC9EDD;
	}

	.home .enterprise-list .list:nth-child(5n+3) .tag {
		background: #8CA3CE;
	}

	.home .enterprise-list .list:nth-child(5n+4) .tag {
		background: #D1AE9E;
	}

	.home .enterprise-list .list:nth-child(5n+5) .tag {
		background: #84CAB0;
	}

	.search .el-input {
		width: 706px;
	}

	.search .el-input.el-input--medium .el-input__inner {
		height: 53px;
		line-height: 53px;
		width: 100%;
		border-radius: 4px 0 0 4px;
		color: #000000 !important;
		font-size: 16px;
	}

	.search .el-input.el-input--medium .el-input__icon {
		line-height: 53px;
		font-size: 18px;
		color: #999999;
	}

	@media (min-width:1920px) {
		.home .header {
			background-size: cover !important;
		}
	}
</style>